package com.ash.service.impl.com.ash;

import com.ash.IHelloService;
import com.ash.service.impl.HelloServiceImpl;
import org.apache.dubbo.config.ProtocolConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.apache.dubbo.config.bootstrap.DubboBootstrap;
import org.apache.dubbo.config.bootstrap.builders.InternalServiceConfigBuilder;

public class Main {

    public static void main(String[] args) {
        ServiceConfig<IHelloService> iHelloServiceServiceConfig = new ServiceConfig<>();
        iHelloServiceServiceConfig.setInterface(IHelloService.class);
        iHelloServiceServiceConfig.setRef(new HelloServiceImpl());


        DubboBootstrap.getInstance()
                .application("provider")
//                .protocol(new ProtocolConfig("dubbo", -1))

                .registry(new RegistryConfig("nacos://127.0.0.1:8848"))
                .service(iHelloServiceServiceConfig)
                .start().await();
    }
}
